package com.man.servlet;



import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.man.bean.AdminMan;
import com.man.bean.People;
import com.man.dao.AdminDao;
import com.man.dao.PeopleDao;



/**
 * Servlet implementation class RegistServlet
 */
@WebServlet("/showhotel")
public class ShowPeopleServlet extends HttpServlet {
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		
		
		String account = request.getParameter("account");
		String account1 = request.getParameter("account1");
		
	
		if(account==null||account.equals("")) {
			List<People> people = new PeopleDao().showPeo();
			request.getSession().setAttribute("pe", people);
			
		}else {
			List<People> people = new PeopleDao().showPeo(account);
			request.getSession().setAttribute("pe", people);
		}
		/*if(account1==null) {
			response.sendRedirect("man/hotel.jsp");
		}else if(account1.equals("1")){
			response.sendRedirect("man/hotel.jsp");
		}*/
		response.sendRedirect("man/hotel.jsp");
	
	
		
		
	}

}
